package userEntity

import (
	"github.com/goravel/framework/database/orm"
	"github.com/goravel/framework/support/carbon"
	"goravel/app/models/systemEntity"
)

type User struct {
	orm.Model
	Username string      `gorm:"column:username" form:"username" json:"username"`
	RealName string      `gorm:"column:real_name" form:"real_name" json:"v"`
	Password string      `gorm:"column:password" form:"password" json:"password"`
	Birthday carbon.Date `gorm:"column:birthday" form:"birthday" json:"birthday"`
	CardId   string      `gorm:"column:card_id" form:"card_id" json:"card_id"`
	Mark     string      `gorm:"column:mark" form:"mark" json:"mark"`
	GroupID  uint        `gorm:"column:group_id" form:"group_id" json:"group_id"`
	Nickname string      `gorm:"column:nickname" form:"nickname" json:"nickname"`
	Phone    string      `gorm:"column:phone" form:"phone" json:"phone"`
	AddIp    string      `gorm:"column:add_ip" form:"add_ip" json:"add_ip"`

	LastTime       carbon.DateTime     `gorm:"column:last_time" form:"last_time" json:"last_time"`
	NowMoney       int                 `gorm:"column:now_money" form:"now_money" json:"now_money"`
	BrokerageMoney int                 `gorm:"column:brokerage_money" form:"brokerage_money" json:"brokerage_money"`
	Integral       int                 `gorm:"column:integral" form:"integral" json:"integral"`
	Exp            int                 `gorm:"column:exp" form:"exp" json:"exp"`
	SignNum        int64               `gorm:"column:sign_num" form:"sign_num" json:"sign_num"`
	Status         int                 `gorm:"column:status;default:1" form:"status" json:"status"`
	Level          int                 `gorm:"column:level;default:1" form:"level" json:"level"`
	UserType       string              `gorm:"column:user_type;default:wechat" form:"user_type" json:"user_type"`
	IsDelivery     int                 `gorm:"column:is_delivery;default:0" form:"is_delivery" json:"is_delivery"`
	PayCount       int64               `gorm:"column:pay_count" form:"pay_count" json:"pay_count"`
	Address        string              `gorm:"column:address" form:"address" json:"address"`
	AdminID        uint                `gorm:"column:admin_id" form:"admin_id" json:"admin_id"`
	LoginType      string              `gorm:"column:login_type" form:"login_type" json:"login_type"`
	Avatar         string              `gorm:"column:avatar" form:"avatar" json:"avatar"`
	StaffID        uint                `gorm:"column:staff_id" form:"staff_id" json:"staff_id"`
	InviteCode     string              `gorm:"column:invite_code" form:"invite_code" json:"invite_code"`
	Roles          []systemEntity.Role `gorm:"many2many:user_roles;" form:"roles" json:"roles"`
	orm.SoftDeletes
}
